package types

import "github.com/bytedance/sonic"

type ErrorRespone struct {
	ErrCode int    `json:"code"`
	ErrMsg  string `json:"msg"`
	ErrTips string `json:"tips"`
}

func (e ErrorRespone) Error() string {
	str, _ := sonic.MarshalString(e)
	return str
}

type BusinessError struct {
	HttpCode int
	ErrorRespone
}

func (e BusinessError) GetHttpCode() int {
	return e.HttpCode
}

func (e BusinessError) GetErrorRespone() error {
	return e.ErrorRespone
}
